package com.ebt.m.utils.os;   

import android.content.Context;
import android.os.Handler;
import android.os.Message;

import com.ebt.m.utils.UIHelper;

/**  
 * 创建时间：2014-11-21 下午2:21:42  
 * 项目名称：EBT.app  
 * @author allen.li  
 * @version 1.0   
 * @since JDK 1.6.0_21  
 * 文件名称：HandlerBase.java  
 * 类说明：  
 */
public class HandlerBase extends Handler {

	public static final int EXCEPTION = 10086;
	public static final int EXCEPTION_CONNECT_TIMEOUT = 10087;
	public static final int EXCEPTION_CONNECT_FAILED = 10088;
	public static final int EXCEPTION_EBTSoapHeader = 10089;
	private Context ctx;
	public HandlerBase(Context context){
		this.ctx = context;
	}
	@Override
	public void handleMessage(Message msg) {
		switch (msg.what) {
		case EXCEPTION_CONNECT_TIMEOUT:
			UIHelper.makeToast(ctx, UIHelper.getAlertMsg(
					UIHelper.EXCEPTION_CONNECT_TIMEOUT, ctx));
			break;
		case EXCEPTION_CONNECT_FAILED:
			UIHelper.makeToast(ctx, UIHelper.getAlertMsg(
					UIHelper.EXCEPTION_INTERNET_FAILED, ctx));
			break;
		case EXCEPTION_EBTSoapHeader:
			UIHelper.makeToast(ctx, UIHelper.getAlertMsg(
					UIHelper.EXCEPTION_INTERNET_FAILED, ctx));
			break;
		default:
			break;
		}
	}
}
